<template>
	
	<div>
		<Subheading>
			<span>爆款推荐</span>
		</Subheading>
		
		<van-card
			v-for="(item,index) in homerecommend" :key='index'
		  :price="item.price"
		  :title="item.title"
		  :thumb="item.pic"
		  @click="goWare(item)"
		/>
		
	</div>
	
	
</template>

<script>
	import Subheading from '@/components/Home/Subheading.vue'
	import {mapState} from 'vuex'
	
	export default {
		name:'Suggest',
		components:{Subheading,},
		data() {
			return  {
				commodity:[
					{tag:'老铁推荐',price:'128',desc:'核心产区滋味正',title:'铁观音2号250g'},
					{tag:'爆款',price:'99',desc:'难以忘怀的桂花香',title:'正山小种3号150g'},
					{tag:'茶友必备',price:'55',desc:'给生活一点精致的仪式感',title:'黑檀镂空六君子'},
				]
			}
		},
		computed:{
			...mapState('commodityList',['homerecommend'])
		},
		methods:{
			//进入商品详情页
			goWare(item) {
				this.$router.push({name:'ware',query:{ware:JSON.stringify(item)}})
			}
			
		}
	}
</script>

<style scoped>
	.van-card__content {
		text-align: right;
		margin-right: 10px;
	}
	.van-card__price-currency {
		color: #B0352F;
		font-size: 14px;
	}
	.van-card__desc{
	    font-size: 15px;
		font-weight: 500;
	}
	.van-card__price-integer {
		color: #B0352F;
		font-size: 20px;
	}
</style>
